import {FieldConfig} from "./AddDynamicForm.tsx";

const formFields: Array<FieldConfig> = [
    {
        type: 'group',
        label: '基本信息',
        name: 'basicInfo',
        children: [
            {
                type: 'input',
                label: '用户名',
                name: 'username',
                required: true,
                options: {
                    placeholder: '请输入用户名',
                },
            },
            {
                type: 'textarea',
                label: '描述',
                name: 'description',
                options: {
                    placeholder: '请输入描述',
                    rows: 4,
                },
            },
            {
                type: 'group',
                label: '时间信息',
                name: 'timeInfo',
                children: [
                    {
                        type: 'date',
                        label: '生日',
                        name: 'birthday',
                        options: {
                            placeholder: '请选择日期',
                        },
                    },
                    {
                        type: 'time',
                        label: '时间',
                        name: 'time',
                        options: {
                            placeholder: '请选择时间',
                        },
                    },
                    {
                        type: 'datetime',
                        label: '预约时间',
                        name: 'appointment',
                        options: {
                            placeholder: '请选择预约时间',
                        },
                    },
                ],
            },
            {
                type: 'select',
                label: '性别',
                name: 'gender',
                optionData: [
                    {value: 'male', label: '男'},
                    {value: 'female', label: '女'},
                ],
                options: {
                    placeholder: '请选择性别',
                },
            },
        ],
    },
    {
        type: 'group',
        label: '位置信息',
        name: 'locationInfo',
        children: [
            {
                type: 'treeselect',
                label: '地区',
                name: 'region',
                optionData: [
                    {
                        value: 'china',
                        label: '中国',
                        children: [
                            {value: 'beijing', label: '北京'},
                            {value: 'shanghai', label: '上海'},
                        ],
                    },
                    {
                        value: 'usa',
                        label: '美国',
                        children: [
                            {value: 'newyork', label: '纽约'},
                            {value: 'losangeles', label: '洛杉矶'},
                        ],
                    },
                ],
                options: {
                    placeholder: '请选择地区',
                },
            },
            {
                type: 'cascader',
                label: '级联选择',
                name: 'cascader',
                optionData: [
                    {
                        value: 'zhongguo',
                        label: '中国',
                        children: [
                            {
                                value: 'beijing',
                                label: '北京',
                                children: [
                                    {value: 'chaoyang', label: '朝阳区'},
                                    {value: 'haidian', label: '海淀区'},
                                ],
                            },
                            {
                                value: 'shanghai',
                                label: '上海',
                                children: [
                                    {value: 'pudong', label: '浦东新区'},
                                    {value: 'minhang', label: '闵行区'},
                                ],
                            },
                        ],
                    },
                    {
                        value: 'usa',
                        label: '美国',
                        children: [
                            {
                                value: 'california',
                                label: '加利福尼亚州',
                                children: [
                                    {value: 'losangeles', label: '洛杉矶'},
                                    {value: 'sanfrancisco', label: '旧金山'},
                                ],
                            },
                            {
                                value: 'newyork',
                                label: '纽约州',
                                children: [
                                    {value: 'newyorkcity', label: '纽约市'},
                                    {value: 'buffalo', label: '布法罗'},
                                ],
                            },
                        ],
                    },
                ],
                options: {
                    placeholder: '请选择',
                },
            },
        ],
    },
    {
        type: 'autocomplete',
        label: '搜索',
        name: 'search',
        options: {
            placeholder: '请输入搜索内容',
            dataSource: ['apple', 'banana', 'cherry', 'date'],
        },
    },
    {
        type: 'upload',
        label: '上传文件',
        name: 'file',
        options: {
            placeholder: '点击上传文件',
            // You can specify additional upload options here
        },
    },
];

export default formFields;